<div> 
  <span> 
    {% if page.has_previous %} 
      <a href="?page={{ page.previous_page_number }}">Previous</a> 
    {% endif %} 
    <span> 
      Page {{ page.number }} of {{ page.paginator.num_pages }}. 
    </span> 
    {% if page.has_next %} 
      <a href="?page={{ page.next_page_number }}">Next</a> 
    {% endif %} 
  </span>
</div>